﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using ParamSetCollection.General.Parameters.Normal;
using ParamSetCollection.General.Parameters.Alarms;
using ParamSetCollection.General.ParamTable;

namespace MainController.Hardware.PLC
{
    public abstract class PlcBasic
    {
        #region 字段
        public bool ParamMsgLock = false;//参数变更消息屏蔽

        #endregion

        #region 普通交互功能

        public static PlcBasic GetMegmitPlc()
        {

            PlcBasic plc = null;
            plc = new MEGMEET.MegPlc();

            return plc;
        }

        public abstract void InitParams(ParamHelper tableData);
        public abstract void Start();
        public abstract void Stop();


        public abstract void DownloadCtx();

        public abstract void ExecuteCmds(List<ParamUnit> pu);


        public abstract void DownLoadRcp(string path);


        public abstract void ReduceParamRange(ParamUnit param);


        public abstract List<ParamUnit> GetSpecificParams(string type);



        public abstract string GetBarCode();
        #endregion

        #region 寄存器操作
        //public abstract bool GetEmRegisterBit(int address);

        //public abstract ushort GetEmRegister(int address);

        //public abstract ushort[] GetEmRegisters(int address, int length);

        //public abstract int GetEmRegisterDW(int address);

        //public abstract int[] GetEmRegistersDWs(int address, int length);


        //public abstract void SetEmRegisterBit(int address, bool value);

        //public abstract void SetEmRegister(int address, ushort value);

        //public abstract void SetEmRegisters(int address, ushort[] values);

        //public abstract void SetEmRegisterDW(int address, int value);

        //public abstract void SetEmRegistersDWs(int address, int[] values);
        #endregion
    }
}
